﻿@{
    ViewBag.Title = "Chọn chỉ tiêu cho năm kế hoạch";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
    List<SelectListItem> allyear = new List<SelectListItem>();
    List<SelectListItem> allyearnew = new List<SelectListItem>();
    int year = DateTime.Now.Year;
    for (int i = year + 1; i >= 2010; i--)
    {
        allyear.Add(new SelectListItem
        {
            Value = i.ToString(),
            Text = i.ToString()
        });
        if (i < year + 1)
        {
            allyearnew.Add(new SelectListItem
            {
                Value = i.ToString(),
                Text = i.ToString()
            });
        }
    }


}
<style>
    table {
        table-layout: fixed;
        word-wrap: break-word;
        font-size: small;
        text-align: center;
    }

    .e-input1 {
        background-color: #fae8e8;
        border: 1px solid #fb8989;
        text-align: left;
        border-radius: 3px;
        padding: 5px;
        height: 26px;
        font-family: "Open Sans", arial !important;
        box-shadow: 0 1px 1px rgba(50,50,50,0.1);
    }

    .e-input2 {
        border: 1px solid #8dc1e1;
        background: #bee6ff;
        text-align: left;
        border-radius: 3px;
        padding: 5px;
        height: 26px;
        font-family: "Open Sans", arial !important;
        box-shadow: 0 1px 1px rgba(50,50,50,0.1);
    }
</style>
<style>
    legend a {
        color: inherit;
    }

    legend.legendStyle {
        padding-left: 5px;
        padding-right: 5px;
    }

    fieldset.fsStyle {
        font-family: Verdana, Arial, sans-serif;
        font-size: small;
        font-weight: normal;
        border: 1px solid #999999;
        padding: 4px;
        margin: 5px;
    }

    legend.legendStyle {
        font-size: 90%;
        color: #888888;
        background-color: transparent;
        font-weight: bold;
    }

    legend {
        width: auto;
        border-bottom: 0px;
    }
</style>
<script>
    @functions{
           public string GetAntiForgeryToken()
           {
               string cookieToken, formToken;
               AntiForgery.GetTokens(null, out cookieToken, out formToken);
               return cookieToken + "," + formToken;
           }
       }
</script>
<link href="~/Content/standard_form_nhaplieu.css" rel="stylesheet" />
<link href="@Url.Content("~/Content/jquery-ui.1.10.2.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.maskedinput.js")"></script>
@Html.AntiForgeryToken()
<div class="page-bar">
    <ul class="page-breadcrumb" style="padding: 4px;">
        <li>
            <i class="fa fa-home"></i>
            <a href="#">@ViewBag.CurrentMenuName</a>
        </li>
    </ul>
</div>
<div class="row margin-bottom-20">
    <div class="col-md-5">
        <div class="row" style="margin-top:5px;">
            @Html.Label("Chọn năm kế hoạch", new { @class = "col-md-5", id = "lb1" })
            <div class="col-md-7">
                @Html.DropDownList("Namkehoach", allyear, new { id = "Namkehoach", style = "margin:0px;", @class = "form-control input-sm" })
            </div>
        </div>
    </div>
    <div class="col-md-5">
        <div class="row" style="margin-top:5px;">
            @Html.Label("Tên mốc kiểm soát", new { @class = "col-md-4" })
            <div class="col-md-8">
                @Html.TextBox("Tenmockiensoat", "", new { @id = "FULL_NAME_SEARCH", @class = "form-control input-sm", style = "", placeholder = "Nhập tên mốc kiểm soát" })
            </div>
        </div>
    </div>
    <div class="col-md-2">
        <div class="row" style="margin-top:5px; text-align:right;">
            <div class="col-md-12">
                <button id="Taomoi" type="button" class="btn btn-sm btn-default" style="width: 90px; margin-bottom: 5px; cursor:pointer;"><i class="fa fa-plus-square-o"></i> Chỉ tiêu</button>
                <button type="submit" class="btn btn-sm btn-default" id="btnSearch" style="width:90px;" name="command" value="Search"><i class="fa fa-search"></i> Tìm kiếm</button>
            </div>
        </div>
    </div>
</div>
<div style="max-height:600px;overflow-y:auto">
    <fieldset class="fsStyle">
        <legend class="legendStyle">
            <a data-toggle="collapse" data-target="#demo" href="#">Danh sách các chỉ tiêu</a>
        </legend>
        <table class="table table-bordered table-hover" style="width: 100%;">
            <thead>
                <tr>
                    <th rowspan="2" colspan="2" style=" width: 8%;">STT</th>
                    <th rowspan="2" style=" width: 25%;">Tên chỉ tiêu</th>
                    <th rowspan="2">Đơn vị phân bổ và giám sát thực hiện</th>
                    <th rowspan="2">Đơn vị tính</th>
                    <th rowspan="2">Tổng mức chỉ tiêu năm <span class="namtruoc"></span> của ĐHQGHN</th>
                    <th rowspan="2">Định hướng năm <span class="namsau"></span> của ĐHQGHN</th>
                </tr>


            </thead>
            <tbody>
                <tr>
                    <td colspan="2">(a)</td>
                    <td class="col-md-3">(b)</td>
                    <td>(c)</td>
                    <td>(d)</td>
                    <td>(f)</td>
                    <td>(h)</td>
                </tr>
            </tbody>
        </table>

    </fieldset>
</div>
<div class="modal-footer">
    <button type="button" id="Ghinhan" data-dismiss="modal" class="btn btn-primary">Ghi nhận</button>
    <button type="button" data-dismiss="modal" class="btn btn-primary">Export</button>
    <button type="button" class="btn btn-default" data-dismiss="modal">Hủy bỏ</button>
</div>





<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header" style="color: white;background-color: #428bca;border-color: #357ebd;">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">Chọn chỉ tiêu</h4>
            </div>
            <div class="modal-body noidung">


            </div>
            <div class="modal-footer">
                <button type="button" id="Update" class="btn btn-primary">Thêm mới</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">Hủy bỏ</button>
            </div>
        </div>
    </div>
</div>

<script src="@Url.Content("~/Scripts/DHQG/NamChitieu.js")" type="text/javascript"></script>
<script>
    $(function () {
        var initData = {
            VerificationToken: "@GetAntiForgeryToken()",
            GetallChitieu: "@Url.Action("GetallChitieu","Kehoachnam")",
            SaveNamChitieu: "@Url.Action("SaveNamChitieu", "Kehoachnam")",
            GetallNamkehoach: "@Url.Action("GetallNamkehoach", "Kehoachnam")",
            GetallChitieubynamchitieu: "@Url.Action("GetallChitieubynamchitieu", "Kehoachnam")",
            GetDonViByNhom: "@Url.Action("GetDonViByNhom", "Kehoachnam")",
            SaveDonViChiTieu: "@Url.Action("SaveDonViChiTieu", "Kehoachnam")",
            GetKehoachbyNamkehoach: "@Url.Action("GetKehoachbyNamkehoach", "Kehoachnam")",
        };
        NamChitieu.init(initData);
    });
</script>